package cn.wolfcode.crm.service.impl;

import cn.wolfcode.crm.domain.Dictionary;
import cn.wolfcode.crm.mapper.DictionaryMapper;
import cn.wolfcode.crm.service.IDictionaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DictionaryServiceImpl implements IDictionaryService {

    @Autowired
    private DictionaryMapper mapper;


    public void delete(Long id) {
        mapper.deleteByPrimaryKey(id);
    }

    public void save(Dictionary entity) {
        mapper.insert(entity);
    }

    public void update(Dictionary entity) {
        mapper.updateByPrimaryKey(entity);
    }

    public Dictionary get(Long id) {
        return mapper.selectByPrimaryKey(id);
    }

    public List<?> list() {
        return mapper.selectAll();
    }
}
